package com.audaque.springboot.foshanupload.web.httpclientdemo.ieg;

import com.audaque.springboot.foshanupload.web.httpclientdemo.ieg.product.model.IegVersion;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Component
@ConfigurationProperties(prefix = "ieg.default")
public class IegDefaultProperties {


    private List<IegVersion> versions = new ArrayList<IegVersion>();


    public List<IegVersion> getVersions() {
        versions.get(0).setReleaseDate(new Date().getTime() / 1000);
        return versions;
    }

}
